package co.fitstart.mobile.entity.appointment;

import co.fitstart.entity.site.Site;
import co.fitstart.entity.site.SiteRoomLimit;

public class RoomPrepare {
    
    private int commonLimit;
    
    private int roomLimit;
    
    private int commonRemain;
    
    private int roomRemain;
    
    /**
     * The default constructor
     */
    public RoomPrepare() {
    }

    /**
     * 
     * @param site
     */
    public RoomPrepare(Site site) {
        
        SiteRoomLimit siteRoomLimit = site.getRoomLimit();
        
        this.roomLimit = siteRoomLimit.getRoomLimit();
        this.commonLimit = siteRoomLimit.getCommonLimit();
    }

    /**
     * 
     * @return
     */
    public boolean isValid() {
        return this.roomRemain > 0 || this.commonRemain > 0;
    }

    /**
     * 
     * @param roomRemain
     * @return
     */
    public RoomPrepare roomRemain(int roomRemain) {
        this.roomRemain = roomRemain;
        return this;
    }

    /**
     * 
     * @param commonRemain
     * @return
     */
    public RoomPrepare commonRemain(int commonRemain) {
        this.commonRemain = commonRemain;
        return this;
    }

    
    /**
     * @return the commonLimit
     */
    public int getCommonLimit() {
        return commonLimit;
    }

    /**
     * @return the roomLimit
     */
    public int getRoomLimit() {
        return roomLimit;
    }

    /**
     * @return the commonRemain
     */
    public int getCommonRemain() {
        return commonRemain;
    }

    /**
     * @return the roomRemain
     */
    public int getRoomRemain() {
        return roomRemain;
    }

    /**
     * @param commonLimit the commonLimit to set
     */
    public void setCommonLimit(int commonLimit) {
        this.commonLimit = commonLimit;
    }

    /**
     * @param roomLimit the roomLimit to set
     */
    public void setRoomLimit(int roomLimit) {
        this.roomLimit = roomLimit;
    }

    /**
     * @param commonRemain the commonRemain to set
     */
    public void setCommonRemain(int commonRemain) {
        this.commonRemain = commonRemain;
    }

    /**
     * @param roomRemain the roomRemain to set
     */
    public void setRoomRemain(int roomRemain) {
        this.roomRemain = roomRemain;
    }
}
